package com.web.kdl.daoV2.auth;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.web.kdl.entity.auth.PermissionInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.HashSet;

/**
 * @Author： shulibin
 * @Date： 2025/7/30 13:47
 * @Describe：
 */
@Mapper
public interface PermissionDao extends BaseMapper<PermissionInfo> {
    @Select("SELECT DISTINCT p.permission_code FROM permission_info p " +
            "INNER JOIN role_permission rp ON p.id = rp.permission_id inner join role_info r on r.id= rp.role_id  " +
            "WHERE r.role_code = #{role}")
    HashSet<String> selectCodeList(String role);

}
